/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
 */
package cn.ibizlab.core.authentication.domain;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.IEntity;
import cn.ibizlab.util.domain.EntityBase;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;

/**
 * 授权系统实体类[AuthGrantedSystem]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@ApiModel(value = "AUTH_GRANTED_SYSTEM", description = "授权系统")
public class AuthGrantedSystem extends EntityBase implements Serializable
{

    /**
     * 系统标识
     */
    @Id
    @DEField(name = "deploy_system_id" , isKeyField = true)
    @JsonProperty("deploy_system_id")
    @JSONField(name = "deploy_system_id")
    @ApiModelProperty(value = "deploy_system_id", notes = "系统标识")
    private String deploySystemId;

    /**
     * 系统名称
     */
    @DEField(name = "display_name")
    @JsonProperty("display_name")
    @JSONField(name = "display_name")
    @ApiModelProperty(value = "display_name", notes = "系统名称")
    private String displayName;

    /**
     * 系统名
     */
    @DEField(name = "system_id")
    @JsonProperty("system_id")
    @JSONField(name = "system_id")
    @ApiModelProperty(value = "system_id", notes = "系统名")
    private String systemId;

    /**
     * 角色
     */
    @DEField(name = "roles")
    @JsonProperty("roles")
    @JSONField(name = "roles")
    @ApiModelProperty(value = "roles", notes = "角色")
    private List<AuthGrantedRole> roles;


    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("deploy_system_id");
        }
        return targetEntity;
    }

}